package cn.lh.service.impl;

import cn.lh.dao.ProductTypeDao;
import cn.lh.entity.dto.ProductTypeDto;
import cn.lh.entity.vo.ProductTypeVo;
import cn.lh.entity.vo.ProductVo;
import cn.lh.service.ProductTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 产品类型表 服务实现类
 * </p>
 *
 * @author linhong
 * @since 2025-04-16
 */
@Service
public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeDao, ProductTypeDto> implements ProductTypeService {


    @Override
    public List<ProductTypeVo> getList() {
        List<ProductTypeDto> list = this.list();
        return list.stream().map(e -> new ProductTypeVo(e.getId(),e.getName())).collect(Collectors.toList());
    }
}
